package com.cskaoyan.market.controller.admin;


import com.cskaoyan.market.annotation.RequiresPermissionsDesc;
import com.cskaoyan.market.db.domain.MarketFeedback;
import com.cskaoyan.market.service.AdminFeedbackService;
import com.cskaoyan.market.util.ResponseUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;

import java.util.List;


@RestController
@RequestMapping("/admin/feedback")
public class AdminFeedbackController extends HttpServlet {

    @Autowired
    AdminFeedbackService adminFeedbackService;

    @GetMapping("list")
    @RequiresPermissions("admin:feedback:list")
    @RequiresPermissionsDesc(menu = {"用户管理", "意见反馈"},button = "查询")
    public Object list(Integer page, Integer limit, String sort, String order,String username,Integer id) {


        List<MarketFeedback> marketFeedbackList = adminFeedbackService.list(page, limit, username, id, sort, order);
        return ResponseUtil.okList(marketFeedbackList);
    }
}
